<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  mounted() {},
  watch: {
    // 监听 $route 对象来响应路由变化
    $route(to, from) {
      from;
      // 判断新路由的路径
      if (to.path === "/personal/setting") {
        document.title = "编辑个人信息";
      } else if (to.name === "publication") {
        document.title = "编辑文章信息";
      } else if (to.name === "chat") {
        document.title = "AI智能写作助手";
      } else {
        document.title = "社区论坛首页";
      }
    },
  },
};
</script>

<style>
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
#app {
  height: 100%;
}
</style>
